<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>MayiktCloud 服务注册中心框架</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<script>
    getData();
    var int = self.setInterval("getData()", 3000);

    function getData() {
        $.get("http://127.0.0.1:8848/mayikt/activeService", function (data, status) {
            var htmlStr = "";
            for (var key in data) {
                htmlStr += "<tr><td>" + key + "</td><td>"
                for (var i = 0; i < data[key].length; i++) {
                    var serviceAddress = data[key][i].serviceAddress;
                    htmlStr += serviceAddress + ";"
                }
                htmlStr += "</td></tr>"
            }
            $("#tb").html(htmlStr);
        });
    }

</script>
<body>
<center>
    <H3>freeCloud 服务注册中心框架</H3>
</center>
<table class="table table-bordered">

    <thead>
    <tr>
        <th>服务名称</th>
        <th>服务地址</th>
    </tr>
    </thead>
    <tbody id="tb">
    </tbody>
</table>
</body>
</html>